import React, { Component } from 'react';

class App extends Component {
    state ={
        inputValue:"🐂"
    }
    handleSubmit =(params) => {
       /*    原生写法:
        let inputvalue =  document.getElementById("inputvalue");
        console.log("提交",inputvalue.value) */
       console.log("提交",this.state.inputValue)
    }
    handleChang = (e) => {
        console.log(e.target.value)
        this.setState({
            inputValue :e.target.value
        })
    }
    render() {
        return (
            <div>
                <input type="text" value={this.state.inputValue} onChange={this.handleChang}/>
                <button id="btn" onClick={this.handleSubmit}>提交</button>
            </div>
        );
    }
}

export default App;
